<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>0.0引入外部vue</title>
    <script src="https://cdn.jsdelivr.net/npm/vue@2"></script>
</head>
<body>
    <div id="root" class="rootdiv">
        <!-- {{ message }}
        {{ person }} -->
    </div>
</body>
</html>

<script>
    console.log('Vue:', Vue);
    let vm = new Vue({
        el: '#root',
        data: {
            person: {
                name: '蒋皓天'
            }
        },
        watch: {
            'person.sex': {
                handler() {
                    console.log('触发变化')
                }
            }
        }
    })

    // vm.person.sex = 'male'
    // vm.$set(vm.person, 'sex', 'male')
</script>